<template>
    <div class="carouselBox">
   <a-carousel arrows>
    <div
      slot="prevArrow"
      
      class="custom-slick-arrow"
      style="left: 10px;zIndex: 1"
    >
      <a-icon type="left-circle" />
    </div>
    <div slot="nextArrow" slot-scope="" class="custom-slick-arrow" style="right: 10px">
      <a-icon type="right-circle" />
    </div>
    <div class="swiperImg" v-for="(item,index) in swiperlist"  :key="index" :style="`background-image: url('${item.imgUrlPc}')`">
      
    </div>
  </a-carousel>
    </div>
</template>

<script>
import {loop} from "../api/api"
export default {
    name:"indexSwiper",
    data(){
      return {
        swiperlist:"[]",
      }
    },
    methods:{
    },

    created(){
      loop(5).then(res=>{
        console.log(res);
        this.swiperlist=res.data
      })
    },
};
</script>

<style scoped >
.swiperImg {
   background-repeat: no-repeat;
    background-position: 50%;
    width: 100%;
    height: 400px;
    background-size: cover;
}
.carouselBox {
    margin-bottom: 50px;
}
/* 轮播图样式设置 */
.swiperImg {
  width: 100%;
  height: 400px;
}
.ant-carousel >>> .slick-slide {
  text-align: center;
  height: 400px;
  line-height: 160px;
  background: #364d79;
  overflow: hidden;
}

.ant-carousel >>> .custom-slick-arrow {
  width: 25px;
  height: 25px;
  font-size: 25px;
  color: #fff;
  background-color: rgba(31, 45, 61, 0.11);
  opacity: 0.3;
}
.ant-carousel >>> .custom-slick-arrow:before {
  display: none;
}
.ant-carousel >>> .custom-slick-arrow:hover {
  opacity: 0.5;
}

.ant-carousel >>> .slick-slide h3 {
  color: #fff;
}
</style>